package com.cc.data_explore.logic.data;

import javafx.beans.property.IntegerProperty;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
import lombok.Getter;
import lombok.Setter;

import java.io.Serial;
import java.io.Serializable;

/**
 * @author cc
 * @version 1.0
 * @since 2025/4/9
 */

public class TableRuleData implements Serializable {
    @Serial
    private static final long serialVersionUID = 4767421770076930930L;

    private final IntegerProperty sourceIndex = new SimpleIntegerProperty(-1);
    private final StringProperty sourceName = new SimpleStringProperty();

    @Setter
    @Getter
    private String targetName;
    @Setter
    @Getter
    private String targetNameEn;
    @Setter
    @Getter
    private Integer targetIndex;

    public int getSourceIndex() {
        return sourceIndex.get();
    }

    public IntegerProperty sourceIndexProperty() {
        return sourceIndex;
    }

    public void setSourceIndex(int sourceIndex) {
        this.sourceIndex.set(sourceIndex);
    }

    public String getSourceName() {
        return sourceName.get();
    }

    public StringProperty sourceNameProperty() {
        return sourceName;
    }

    public void setSourceName(String sourceName) {
        this.sourceName.set(sourceName);
    }

    @Override
    public String toString() {
        return "TableRuleData{" +
                "sourceIndex=" + sourceIndex +
                ", sourceName=" + sourceName +
                ", targetName='" + targetName + '\'' +
                ", targetIndex=" + targetIndex +
                '}';
    }
}
